package com.yn.pet.controller.pc.request;


import com.yn.common.utils.bean.BeanUtils;
import com.yn.pet.bus.entity.GenFence;
import lombok.Data;

import javax.validation.constraints.NotNull;

@Data
public class FenceSaveRequest {


    //设备ID
    @NotNull(message = "请选择设备")
    private Long deviceId;

    //围栏名称
    @NotNull(message = "请输入围栏名称")
    private String fenceName;

    //围栏类型 1-圆形 2-多边形
    @NotNull(message = "请选择围栏类型")
    private Integer fenceType;

    //中心纬度(圆形)
    private Double centerLat;

    //中心经度(圆形)
    private Double centerLng;

    //半径米(圆形)
    private Integer radius;

    //多边形顶点坐标(json)
    private String vertices;

    //围栏地址
    private String fenceAddress;

    //报警设置
   /* @NotNull(message = "请选择报警设置")
    private Integer alarmType;*/

    public static GenFence transform(FenceSaveRequest request) {
        if(request == null){
            return null;
        }
        GenFence fence = new GenFence();
        BeanUtils.copyProperties(request, fence);
        return fence;
    }
}
